Arexx (6/45)

From:Dave Clarke
Date:12 Aug 2001 at 07:10:04
Subject:Re: Back to my "ITERATE" problem

Once upon a time, 11-Aug-01 13:49:28, Andrew Bruno spoke thus about
'[arexx] Back to my "ITERATE" problem':

>I have now got back into the swing of things and am playing with this
>"terminate the loop" thing.

>This is the example program:

>/* */

>ECHO 'Starting the program.'

>test.1 = "ANDREW"
>test.2 = "BARNEY"
>test.3 = "CHARLIE"
>test.4 = "DANNIEL"
>test.5 = "EDWARD"
>test.6 = "FREDERICK"

>name = "EDWARD"

>DO i = 1 to 6
> IF name = test.i THEN
> DO
> ECHO 'Found'
> ITERATE i
> END
> ECHO i
>END

>ECHO 'Exiting program'

If you're trying to terminate the loop when you've found a match then you
should be using LEAVE or BREAK depending on your circumstances.

>So I guess the ITERATE command is not doing what I want.

>I guess the best way to do it is instead of the ITERATE i line, I should put
>in i=6 and it will then stop altogether - right?

ITERATE causes the next iteration of the loop, (ie. simply put, returns
script flow back to the previous DO command).

Dave



_--_|\ Dave Clarke | Four Wheel Drive: - Helps you get stuck |
/ \ | faster, harder, further from help.|
\_.--.*/ <-Melbourne | Powered by: A3000 '060/50+604/180 138MB |
v bj73@cryogen.com | P-IV/Concierto/Pablo/Paloma |


Ah, you've come to help me find the Zero Room. -- The Doctor

ARexx mailing list - No flames, no overquoting, no crossposting.
Unsub: Blank mail to mailto:arexx-unsubscribe@yahoogroups.com

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/